<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../day9//ajax.js"></script>
</head>

<body>
    <script>
        function reTxt(url) {
            return new Promise(function (resolve, reject) {
                ajax({
                    url: url,
                    success: function (txt) {
                        console.log(txt);
                        resolve(txt);
                    }
                })
            })

        }
        async function fn() {
            console.log("开始执行");
            var str = '';
            var p1 = await reTxt("../day9/data/1.txt");
            console.log("p1", p1);
            行啊哈啊啊;
            str += p1;
            var p2 = await reTxt("../day9/data/2.txt");
            console.log("p2", p2);
            str += p2;
            console.log("执行开始了骂");
            return str;

        }
        var reslut = fn();
        console.log(reslut);
        reslut.then(v => { return 1 }).catch(err => { throw err });


    </script>
</body>

</html>